
RedDotsInvasionKickedHandler ={};
local this = RedDotsInvasionKickedHandler;

function this.init()
    CloseEvent(Config.EventType.InvasionKickedUpdate,this.update);
    ListenEvent(Config.EventType.InvasionKickedUpdate,this.update);
    return this;
end

function this.getFlag(...)
    if not logicMgr.FuncOpenManager.isOpen(Config.FuncOpenType.InvasionBattle,false) then
        return Config.RedDotsFlagState.None
    end
    if not logicMgr.InvasionManager.IsOpen() then
        return Config.RedDotsFlagState.None
    end
    local state = Config.RedDotsFlagState.None
    if logicMgr.InvasionManager.IsInvasionKicked()then
        state = Config.RedDotsFlagState.Needful
    end
    return state
end

function this.update()
    RedDotsManager.addBroadcast(Config.RedDotsType.InvasionKicked);
end